<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/taglibs.jsp" %>
<html>
<head> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="toolbar">
<form id="list" action="list">
<div id="search" class="easyui-panel" title="商品查询" data-options="fit:true,collapsible:true,border:0"> 
  <table class="searchTable">
	<tr>
		<td>名称：</td>
		<td><input type="text" id="title" name="title"></td>
		<td>类型：</td>
		<td><input type="combo" id="type" name="type"></td>
		<td><button id="queryBtn" type="button" class="button">查询</button></td>
		<td><button id="clearBtn" type="button" class="button">清空</button></td>
	</tr>
   </table>
</div>
</form>
<div class="operate">
	<div class="om-panel-header">单页信息列表</div>
	<div class="icon">
		<ul>
<shiro:hasPermission name="singlepage:add">  
			<li><a href="javascript:showAdd('/singlepage/showAdd',1000,650);"><span class="menu1"></span>添加</a></li>
</shiro:hasPermission>   
<shiro:hasPermission name="singlepage:delete">  
    		<li><a href="#" onclick="removeRow('id');"><span class="menu11"></span>删除</a></li>
</shiro:hasPermission>   
		</ul>
	</div>
</div>
</div>
<table id="grid" data-options="fit:true,border:false"></table>
</body>
<script type="text/javascript">
$(function() {
	$('#grid').datagrid({   
	    url:'list', 
	    pageSize :10,
		pageList : [10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 1000],
		striped : true,
		//rownumbers : true,
		pagination : true,
		toolbar : '#toolbar',
	    columns : [[
	                 {width : '50', field : 'ck',checkbox:true},
	                 {width : '150',title : '名称',field : 'title'},
	                 {width : '80',title : '类型',field : 'type',formatter:function(v,r){return JSON.parse('${newsTypeMap}')[v]}},
	                 {width : '250',title : '描述',field : 'remark'},
	                 {width : '80',title : '浏览次数',field : 'browseNum',sortable:true},
	                 {width : '50',title : '状态', field : 'status',formatter:function(v,r){return JSON.parse('${statusMap}')[v]}},
	                 {width : '100',title : '发布日期',align : 'center', field : 'editDate',sortable:true , formatter:function(v,r){if(v != ""){return v;}else{return "————"}}},
 					 {width : '200',title : '操作',field : 'id',
	      	                formatter:function(v,r){
	      	                	var html = "";
<shiro:hasPermission name="singlepage:update">  
html += "<a class='osbut' href='#' onclick='openUrl(\"/singlepage/showEdit?id="+r.id+"\",1000,650);'><span class='menu13'></span>编辑</a>";
</shiro:hasPermission>   
	      	              
<shiro:hasPermission name="singlepage:delete">  
html = html+" | <a class='osbut' href='#' onclick='ajaxUrl(\"/singlepage/delete?ids="+r.id+"\",\"是否确认删除\",\"删除成功\");'><span class='menu11'></span>删除</a>";
</shiro:hasPermission>   
	        	                    return html ? html :"没有其他权限";
	        	            }
	 				}
	            ]]
	}); 
	
	//状态
	$('#type').combobox({  
    	data:JSON.parse('${typeCombo}'),
    	panelHeight:'auto'
    });
});

</script>
</html>